AJAX

Display Record's Description Through AJAX

Description
This customization utilizes the power of AJAX to make an asynchronous call to an AJAX method. The AJAX method queries the database to retrieve values for any selected record in a table control and displays the details in a JavaScript popup window. You will need to implement two JavaScript functions to call the AJAX method and to receive the asynchronous callback.
Variables
Table Name
Select the database table whose field values need to be displayed
Record ID
Select the field that corresponds to the record ID for the selected table
Description Field
Select the field containing the description that needs to be displayed in the JavaScript popup window
Applies to
Page class
Code
 
    ''' 
    ''' All web methods need to be defined with the WebMethod tag.
    ''' 
     _
    Public Shared Function GetRecordDescription(ByVal MyRecordID As Integer) As String
            ' For INTEGER Id's
            Dim whereStr As String = "${Record ID} = " & MyRecordID
            ' For STRING Id's, comment out above line and uncomment below line.
            ' Dim whereStr As String = "${Record ID} = '" & MyRecordID & "'"

        Dim rec As ${${Table Name}RecordClassName} = ${${Table Name}ClassName}.GetRecord(whereStr)
        
        'In this example the description of the selected record is retrieved
        Dim content As String = "The description for the chosen record is " & rec.${Description Field}
        
        Return content
    End Function
     

Terms of Service Privacy Statement